/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SStoreConverter.java
 * Created：		2016年7月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.user.converter;


import org.springframework.core.convert.converter.Converter;
import com.thor.palmmall.rest.user.AChannelContents;
import com.thor.palmmall.spi.user.SChannelContents;


/**
 * @author Captain
 *
 */
public class AChannelContentsConverter implements Converter<SChannelContents, AChannelContents> {

  public static AChannelContentsConverter getInstance() {
    if (instance == null)
      instance = new AChannelContentsConverter();
    return instance;
  }

  private static AChannelContentsConverter instance;

  private AChannelContentsConverter() {
  }

  @Override
  public AChannelContents convert(SChannelContents source) {
    if (source == null)
      return null;

    AChannelContents target = new AChannelContents();

    target.setAPP_ID(source.getAPP_ID());
    target.setAPPSECRET(source.getAPPSECRET());
    target.setGATEWAY(source.getGATEWAY());
    target.setMCHID(source.getMCHID());
    target.setNOTIFYPAY(source.getNOTIFYPAY());
    target.setPAY_NOTIFY(source.getPAY_NOTIFY());
    target.setPRIVATE_KEY(source.getPRIVATE_KEY());
    target.setPUBLIC_KEY(source.getPUBLIC_KEY());
    target.setSELER_ID(source.getSELER_ID());
    target.setSIGN_TYPE(source.getSIGN_TYPE());
    target.setUNIFIEDORDERURL(source.getUNIFIEDORDERURL());
    target.setAccountNumber(source.getAccountNumber());
    
    target.setMerchantId(source.getMerchantId());
    target.setFrontRequestUrl(source.getFiletransurl());
    target.setAppRequestUrl(source.getApptransurl());
    target.setBackRequestUrl(source.getBacktransurl());
    target.setCardRequestUrl(source.getCardtransurl());
    target.setSingleQueryUrl(source.getSinglequeryurl());
    target.setBatchTransUrl(source.getBatchtransurl());
    target.setFileTransUrl(source.getFiletransurl());
    target.setJfFrontRequestUrl(source.getJffronttransurl());
    target.setJfAppRequestUrl(source.getJfapptransurl());
    target.setJfBackRequestUrl(source.getJfbacktransurl());
    target.setJfCardRequestUrl(source.getJfcardtransurl());
    target.setJfSingleQueryUrl(source.getJfsinglequeryurl());
    target.setVersion(source.getVersion());
    target.setSignMethod(source.getSignmethod());
    target.setIfValidateRemoteCert(source.isIfvalidateremotecert());
    target.setBackUrl(source.getBackurl());
    target.setFrontUrl(source.getFronturl());
    target.setSignCertPath(source.getSigncertpath());
    target.setSignCertPwd(source.getSigncertpwd());
    target.setSignCertType(source.getSigncerttype());
    target.setEncryptCertPath(source.getEncryptcertpath());
    target.setMiddleCertPath(source.getMiddlecertpath());
    target.setRootCertPath(source.getRootcertpath());
    target.setIfValidateCNName(source.isIfvalidatecnname());
    target.setMchKey(source.getMchKey());
    return target;
  }

}
